StupidBeauty
Read times:3503Posted at:Fri Oct 18 19:58:01 2013
- no title specified

转载:Wrong shapes for given matrices in OPENCV

问题跟原因之间看起来没有什么直接的联系,不过勒, OpenCV Error: Bad argument (Wrong shapes for given matrices. Was size(src) = (1,921600),

size(W) = (307200,6).) in subspaceProject, 这种错误,一般是因为妳所调用的那个 opencv api只支持灰度图,而妳却载入了一张彩色图而造成的。

http://stackoverflow.com/questions/12032658/wrong-shapes-for-given-matrices-in-opencv

亮点:

Although you don't provide enough code to verify, I can infer the problem from the given number of elements. Your test matrix is 921600 = 3 * 307200 ... So I guess your input matrix is not a grayscale matrix, but still is in BGR representation.

You should use cv::cvtColor to convert the matrix to grayscale, before resizing it:

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4